﻿using System;

namespace WorldOfMUDra
{
    public class StackableItem : XmlLoadedItem
    {
        uint _amount;
        public uint Amount
        {
            get { return _amount; }
            set { _amount = value; }
        }

        public override string Name { get { return base.Name + "(" + _amount.ToString() + ")"; } }

        public override bool Obtainable
        {
            get 
            {
                return _amount > 0;
            }
        }

        public StackableItem(string nof)
            : base(nof)
        {
            if (base.Tags.ContainsKey("amount")) { _amount = (uint)Int32.Parse(base.Tags["amount"]); }
        }

        public override void OnFirstPickUp(Player p) { }

        public override void OnLook(Player p) { }

        public override void OnPickUp(Player p) { }
    }
}
